<script>
	// import vconsole from 'vconsole'
	import {
		login
	} from '@/api/index.js'

	const loginWithCode = async (code) => {
		let res = await login({
			'code': code
		})
		if (res?.code) {
			console.log(res.data);
			console.log(res.data.token.token);
			uni.setStorageSync('token', res.data.token.token)
		}
	}
	export default {
		onLaunch: function(e) {
			console.log('App Launch')
			// uni.login({
			// 	success: (res) => {
			// 		console.log('login', res);
			// 		loginWithCode(res.code)
			// 	}
			// })
			// if (e.query.debug) {
			// 	if (e.query.debug == 1 && !this.$vconsole) {
			// 		this.$vconsole = new vconsole();
			// 	}
			// }
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';

	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';

	// 设置整个项目的背景色
	page {
		background-color: #F6F6F8;
	}

	.mPage {
		width: 100vw;
		display: flex;
		flex-direction: column;
	}

	/* #endif */
	.example-info {
		font-size: 14px;
		color: #333;
		padding: 10px;
	}
</style>